<tagLib name="cx,html" />
<script type="text/javascript" src="__PUBLIC__/Js/jquery.form.js"></script>
<div class="post" id="post-{$post.ID}">
	<h2>{$post.post_title|Input::forShow}</h2>
	<if condition="$post['post_type'] eq 'post'">
	<div style="height: 20px;">
	<span class="post-cat"><a href="{:url($post['slug'],'Category')}" title="显示{$post.name|Input::forTag}的所有日志" rel="category">{$post.name|Input::forShow}</a></span>
	<span class="post-calendar">{$post.post_date}</span>
	</div>
	</if>
	<div><span style="font-weight: bold">Tags:</span> {$tags}</div>
	<div class="post-content">	
	{~apply_action("before_post")}
		{$post.post_content|apply_filter='content_filter',###}
		<div id="attach_list">
			<if condition="count($attachList) gt 0">
			<h3>附件列表</h3>
			<volist name="attachList" id="attach">
			<div>{$attach}</div>
			</volist>
			</if>
		</div>
	{~apply_action("after_post")}
		<if condition="Session::get(C('USER_AUTH_KEY')) eq $post['post_author']">
		<a href="{$options.siteurl|Input::forTag}/admin.php?s=/Blog/post/ID/{$post.ID}" title="编辑日志">Edit</a>
		</if>
		<div class="floatleft">
		<if condition="$prePostVo">
		&laquo; <a href="{:blogurl($prePostVo)}">{$prePostVo.post_title|Input::forShow}</a>
		</if>
		</div>
		<div class="floatright">
		<if condition="$nextPostVo">
		<a href="{:blogurl($nextPostVo)}">{$nextPostVo.post_title|Input::forShow}</a> &raquo;
		</if>
		</div>
	</div>
	{~apply_action("before_comment")}
	<h3 id="comments">{$post.comment_count} Responses to &#8220;{$post.post_title|Input::forShow}&#8221;</h3>
	<if condition="$post['ping_status'] eq 'open' and $options['default_ping_status'] eq 'open'">
	<script language="javascript">
	function CopyTrackBack(text, alertmsg){
		if(window.clipboardData) {
			window.clipboardData.setData('Text', text);
			alert(alertmsg);
		} else if(prompt('使用 Ctrl+C 复制到剪贴板', text)) {
			alert(alertmsg);
		}
	}
	</script>
	点击<a href="javascript:void(0)" onclick="CopyTrackBack('http://{$Think.server.HTTP_HOST}{:url('trackback','Comment','',APP_NAME,array('ID'=>$post['ID']))}','引用通告地址已经复制到剪贴板')">这里</a>将引用通告地址复制到剪贴板
	</if>
	<ol class="commentlist">
	<volist name="post['commentList']" id="comment">
		<li class="<eq name='key%2' value='0'>alt</eq>" id="comment-{$comment.comment_ID}">
			<if condition="$comment['comment_approved'] eq '1'">
			<cite>
			<if condition="!empty($comment['comment_author_url'])">
			<a href="{$comment.comment_author_url|Input::forTag}" target="_blank">{$comment.comment_author|Input::forShow}</a>
			<else />
			{$comment.comment_author|Input::forShow}
			</if>
			</cite> Says:<br />
			<small class="commentmetadata"><a href="#comment-739" title="">{$comment.comment_date}</a></small>
			{$comment.comment_content|Input::forShow}
			<else />
			未审核的评论
			</if>
		</li>
	</volist>
	</ol>
	
	<if condition="$post['comment_status'] eq 'open' and $options['default_comment_status'] eq 'open'">
		<script language="javascript">
			function PreparePost()
			{
				$("#infoSpan").html('<img src="__PUBLIC__/Images/loading.gif" />');
			}
			
			function ProcessResponse(data)
			{
				if(data.status == 1)
				{
					$("#infoSpan").html(data.info);
					setTimeout(function(){ window.location='{:url($post["ID"],"Blog","",APP_NAME,array("ts"=>time()))}#comment-'+data.data; },1000);
				}
				else
				{
					$("#infoSpan").html("<font color=red>" + data.info + "</font>");
					$("#infoSpan").fadeOut(3000);
					window.setTimeout(function(){ $("#infoSpan").hide(); },3000);
				}
			}
			
			$(document).ready(function() { 
			    var options = { 
					beforeSubmit: PreparePost,
			        success: ProcessResponse,
					dataType: 'json'
			    }; 
			
			    $('#commentform').ajaxForm(options); 
			});
		</script>		
		<h3 id="respond">发表评论</h3>
		<form action="{:url('post','Comment')}" method="post" id="commentform">
		<p><input type="text" name="comment_author" id="author" value="" size="22" tabindex="1" />
		<label for="author"><small>名称（必填）</small></label></p>
		<p><input type="text" name="comment_author_email" id="email" value="" size="22" tabindex="2" />
		<label for="email"><small>电子邮箱（不公开）（必填）</small></label></p>
		<p><input type="text" name="comment_author_url" id="url" value="" size="22" tabindex="3" />
		<label for="url"><small>网址</small></label></p>
		<script language="javascript">
		function fleshVerify() {
		   var timenow = new Date().getTime();
		   document.getElementById("verifyImg").src="{:url('verify','Blog','',APP_NAME,array('h'=>'1','ts'=>'"+timenow+"'))}";
		}
		</script>
		<p><input type="text" name="verify" id="verify" style="width:50px" size="5" tabindex="4" /> <img style="margin-bottom:-6px;*margin-bottom:-3px" class="attachIcon" id="verifyImg" src="{:url('verify','Blog')}" onclick="fleshVerify()" style="padding:0;" /><label for="verify"><small> 验证码 （必填） 点击图片刷新验证码</small></label></p>
		<p><textarea name="comment_content" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
		<p><input type="hidden" name="ajax" value="1" /><input name="submit" type="submit" id="submit" tabindex="5" value="提交评论" />
		<input type="hidden" name="comment_post_ID" value="{$post.ID}" /><br /><span id="infoSpan"></span>
		</p>
		</form>
	</if>
</div><!--/post -->